package uutalk.netcloud.talk.base.util;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import com.uuzuche.lib_zxing.activity.CodeUtils;

import uutalk.netcloud.talk.R;
import uutalk.netcloud.talk.app.BootstrapApp;

/**
 * Created by Administrator on 2017/4/12.
 */

public class ZxingUtils {
    /**
     * 根据字符串生成二维码
     * @param str
     * @return
     */
    public static Bitmap encodeAsBitmap(String str){
        Bitmap bitmap = CodeUtils.createImage(str,400,400, BitmapFactory.decodeResource(BootstrapApp.get().getResources(), R.mipmap.ic_launcher));
        return bitmap;
    }

}
